﻿using System;
using Xtensive.Orm;

namespace IndexWithSortOrder.Model
{
    /*
     * Adding 'ASC' or 'DESC' after the field name will configure the order of items in the index
     */
    [HierarchyRoot]
    [Index("HireDate:DESC", Name = "IX_HIREDATE")]
    public class Employee : Entity
    {
        [Field, Key]
        public int Id { get; private set; }

        [Field]
        public DateTime HireDate { get; set; }

        [Field]
        public string FirstName { get; set; }

        [Field]
        public string LastName { get; set; }

        public Employee(Session session) :
            base(session)
        {}
    }
}